//
//  GWTopicHeaderView.m
//  百思不得姐
//
//  Created by qianfeng on 16/3/7.
//  Copyright © 2016年 高炜. All rights reserved.
//

#import "GWTopicHeaderView.h"

@interface GWTopicHeaderView ()
@property(nonatomic,weak)UILabel *titleLabel;
@end
@implementation GWTopicHeaderView

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self =[super initWithReuseIdentifier:reuseIdentifier]) {
        UILabel*titleLabel =[[UILabel alloc]init];
        titleLabel.width =200;
        titleLabel.x =GWEssencCellMargin;
        titleLabel.textColor =myColor(67, 67, 67);
        titleLabel.autoresizingMask =UIViewAutoresizingFlexibleHeight;
        [self.contentView addSubview:titleLabel];
        self.titleLabel =titleLabel;
        
        self.contentView.backgroundColor =GWGlobalBGColor;
    }
    return self;
}

+(instancetype)headerViewWithTableView:(UITableView *)tableView
{
    GWTopicHeaderView *headerView =[tableView dequeueReusableHeaderFooterViewWithIdentifier:@"header"];
    if (headerView==nil) {
        headerView =[[GWTopicHeaderView alloc]initWithReuseIdentifier:@"header"];
    }
    return headerView;
}
-(void)setTitle:(NSString *)title
{
    _title =title;
    _titleLabel.text =title;
}
@end
